package com.srplab.examples;

import android.app.Activity;
import android.os.Bundle;
import com.srplab.www.starcore.*;

public class Java_callActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
		StarCoreFactory starcore= StarCoreFactory.GetFactory();
        //StarServiceClass Service=starcore._InitSimple("test","123",0,0,"/sdcard/srplab/serverapp/AddFunction.lua?script=lua");
		StarServiceClass Service=starcore._InitSimple("test","123",0,0,"/sdcard/srplab/serverapp/AddFunction.py?script=python");
		//StarServiceClass Service=starcore._InitSimple("test","123",0,0,"/sdcard/srplab/serverapp/libAddFunction.so");
		StarObjectClass a = Service._GetObject("TestClass")._New();
		a = a._Assign(new StarObjectClass(){
	    	public int Add(StarObjectClass self,int x,int y)
	    	{
		    	return x+y+100;
	    	}			
		});
        System.out.println(a._Call("Add",12,34));        
    }
}